import request from '@/utils/request'
const baseUrl = '/file/record'
const recycleBaseUrl = '/file/recycle'
const handleBaseUrl = '/file/handleFile'

// 获取分页数据
export function getList(listQuery) {
  return request({
    url: baseUrl+'/getByPage',
    method: 'post',
    data: listQuery
  })
}

// 获取分页数据(回收站)
export function getRecycleList(listQuery) {
  return request({
    url: recycleBaseUrl+'/getByPage',
    method: 'post',
    data: listQuery
  })
}

// 延迟删除文件
export function asynDeleteFile(ossFileId) {
  return request({
    url: handleBaseUrl+'/asynDeleteFile',
    method: 'get',
    params: {
      ossFileId: ossFileId
    }
  })
}
// 恢复文件
export function recoveryFileByAsynDelete(ossFileId) {
  return request({
    url: handleBaseUrl+'/recoveryFileByAsynDelete',
    method: 'get',
    params: {
      ossFileId: ossFileId
    }
  })
}

//直接删除文件
export function deleteFile(ossFileId) {
  return request({
    url: handleBaseUrl+'/deleteFile',
    method: 'get',
    params: {
      ossFileId: ossFileId
    }
  })
}
